/*
    SDL - Simple DirectMedia Layer
    Partial implementation of SDL library (originally written by
    Sam Lantinga <slouken@libsdl.org>) for the particular purpose to support
    Prequengine (http://code.google.com/p/prequengine/) on BlackBerry(tm)
    tablets and smartphones.

    Copyright (C) 2013  xlamsp

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

    xlamsp@gmail.com
*/

#ifndef SDL_CONFIG_BB_H_
#define SDL_CONFIG_BB_H_

/* Logging facilities */
#define SDL_LOG_LEVEL_NONE          0
#define SDL_LOG_LEVEL_ERROR         1
#define SDL_LOG_LEVEL_WARNING       2
#define SDL_LOG_LEVEL_INFO          3
#define SDL_LOG_LEVEL_DEBUG1        4
#define SDL_LOG_LEVEL_DEBUG2        5

#ifndef SDL_LOG_LEVEL
    #define SDL_LOG_LEVEL       SDL_LOG_LEVEL_INFO      /* default log level */
#endif

#if SDL_LOG_LEVEL < SDL_LOG_LEVEL_ERROR
#define SDL_LOG_ERROR(fmt, ...)
#else
#define SDL_LOG_ERROR(fmt, ...)     fprintf(stderr, "ERR [%.5d] %s(): "fmt"\n", __LINE__, __FUNCTION__, ##__VA_ARGS__)
#endif

#if SDL_LOG_LEVEL < SDL_LOG_LEVEL_WARNING
#define SDL_LOG_WARNING(fmt, ...)
#else
#define SDL_LOG_WARNING(fmt, ...)   fprintf(stderr, "WRN [%.5d] %s(): "fmt"\n", __LINE__, __FUNCTION__, ##__VA_ARGS__)
#endif

#if SDL_LOG_LEVEL < SDL_LOG_LEVEL_INFO
#define SDL_LOG_INFO(fmt, ...)
#else
#define SDL_LOG_INFO(fmt, ...)      fprintf(stderr, "INF [%.5d] %s(): "fmt"\n", __LINE__, __FUNCTION__, ##__VA_ARGS__)
#endif

#if SDL_LOG_LEVEL < SDL_LOG_LEVEL_DEBUG1
#define SDL_LOG_DEBUG1(fmt, ...)
#else
#define SDL_LOG_DEBUG1(fmt, ...)    fprintf(stderr, "DG1 [%.5d] %s(): "fmt"\n", __LINE__, __FUNCTION__, ##__VA_ARGS__)
#endif

#if SDL_LOG_LEVEL < SDL_LOG_LEVEL_DEBUG2
#define SDL_LOG_DEBUG2(fmt, ...)
#else
#define SDL_LOG_DEBUG2(fmt, ...)    fprintf(stderr, "DG2 [%.5d] %s(): "fmt"\n", __LINE__, __FUNCTION__, ##__VA_ARGS__)
#endif

/* This is a set of defines to configure the SDL features */
typedef signed char         int8_t;
typedef unsigned char       uint8_t;
typedef signed short        int16_t;
typedef unsigned short      uint16_t;
typedef signed int          int32_t;
typedef unsigned int        uint32_t;
typedef signed long long    int64_t;
typedef unsigned long long  uint64_t;

extern int errno;

#endif /* SDL_CONFIG_BB_H_ */

